package com.example.demo.service.impl;

import com.example.demo.dao.DataSourceConfigDao;
import com.example.demo.entity.DataSourceConfig;
import com.example.demo.service.DatabaseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author zhouzq1@chinaexpressair.com
 * @title
 * @date 2021/4/26 16:53
 **/
@Service
public class DatabaseServiceImpl implements DatabaseService {
    @Resource
    private DataSourceConfigDao otherDataSourceDao;

    @Override
    public DataSourceConfig findByName(String datasourceName) {
        DataSourceConfig entity = new DataSourceConfig();
        entity.setDataSourceName(datasourceName);
        return otherDataSourceDao.selectOne(entity);
    }
}
